//index.js
Page({
  data: {
    listData0:[
      {'code':'0',"entry_code":"1129","entry_name":"三至四人间","entry_price":"23","entry_num":"1","price":"23"},
      {'code':'0',"entry_code":"1152","entry_name":"住院静脉输液","entry_price":"2.2","entry_num":"3","price":"6.6"},
      {'code':'0',"entry_code":"1256","entry_name":"三级护理","entry_price":"14","entry_num":"1","price":"14"},
      {'code':'0',"entry_code":"0256","entry_name":"氯化钠","entry_price":"4.5","entry_num":"2","price":"9"},
      {'code':'0',"entry_code":"1256","entry_name":"纳洛酮","entry_price":"31.2","entry_num":"1","price":"31.2"},
      {'code':'0',"entry_code":"25","entry_name":"一次性注射器","entry_price":"0.65","entry_num":"2","price":"1.21"},
      {'code':'0',"entry_code":"26","entry_name":"一次性输液器","entry_price":"0.81","entry_num":"2","price":"1.62"},
      {'code':'1',"entry_code":"1129","entry_name":"三至四人间","entry_price":"23","entry_num":"1","price":"23"},
      {'code':'1',"entry_code":"1152","entry_name":"住院静脉输液","entry_price":"2.2","entry_num":"3","price":"6.6"},
      {'code':'1',"entry_code":"1256","entry_name":"三级护理","entry_price":"14","entry_num":"1","price":"14"},
      {'code':'1',"entry_code":"0256","entry_name":"氯化钠","entry_price":"4.5","entry_num":"2","price":"9"},
      {'code':'1',"entry_code":"1256","entry_name":"纳洛酮","entry_price":"31.2","entry_num":"1","price":"31.2"},
      {'code':'1',"entry_code":"25","entry_name":"一次性注射器","entry_price":"0.65","entry_num":"2","price":"1.21"},
      {'code':'1',"entry_code":"26","entry_name":"一次性输液器","entry_price":"0.81","entry_num":"2","price":"1.62"},
      {'code':'2',"entry_code":"125","entry_name":"病历工本费","entry_price":"0.5","entry_num":"1","price":"0.5"},
      {'code':'2',"entry_code":"332","entry_name":"门诊诊查费","entry_price":"15","entry_num":"1","price":"15"},
      {'code':'2',"entry_code":"566","entry_name":"针灸","entry_price":"2","entry_num":"10","price":"20"},
      {'code':'3',"entry_code":"125","entry_name":"病历工本费","entry_price":"0.5","entry_num":"1","price":"0.5"},
      {'code':'3',"entry_code":"332","entry_name":"门诊诊查费","entry_price":"15","entry_num":"1","price":"15"},
      {'code':'3',"entry_code":"165","entry_name":"血常规检查","entry_price":"20","entry_num":"1","price":"20"},
      {'code':'3',"entry_code":"369","entry_name":"维生素C","entry_price":"5","entry_num":"2","price":"5"},
    ],
    listData:[],
    motto: [
      {'code':'0','isF':false,'type':'住院确费','mzcode':'','zycode':'5622','jzr':'孙舞柳','time':'2021年5月4日','jzks':'精神科','cwcode':'26','price':'45.5','taketime':'2021年5月5日'},
      {'code':'1','isF':false,'type':'住院确费','mzcode':'','zycode':'4568','jzr':'孙舞柳','time':'2021年5月3日','jzks':'精神科','cwcode':'26','price':'86.63','taketime':'2021年5月4日'},
      {'code':'2','isF':false,'type':'门诊确费','mzcode':'445685','zycode':'','jzr':'孙舞柳','time':'2021年5月3日','jzks':'中医科','cwcode':'','price':'35.5','taketime':'2021年5月3日'},
      {'code':'3','isF':false,'type':'门诊确费','mzcode':'456855','zycode':'','jzr':'王散思','time':'2021年5月3日','jzks':'外科','cwcode':'','price':'45.5','taketime':'2021年5月3日'},
    ],

  },

  aa: function(e) {
    //展开收起
    var that = this;
    var indexs = e.currentTarget.dataset.current;
    var datas = [];
    that.data.motto[indexs].isF = !that.data.motto[indexs].isF;
    for (const element of that.data.listData0) {
      if (element.code == indexs){
        datas.push(element)
      }
    }
    console.log(datas)
    that.setData({
      motto: that.data.motto,
      //确定显示
      listData: datas,
    })
    

  }
})
